<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
	<table cellpadding="5" cellspacing="0" width="100%">
		<?php
			$querycat = "SELECT * FROM productdownloadcategories";
			$resultcat = mysql_query($querycat) or die(mysql_error());
			
			while($rowcat = mysql_fetch_array($resultcat)){?>
			<tr>	
				<td class="sp_home_title" width="100%">
					<?php echo $rowcat['titleDownload'];?>
				</td>
			</tr>
			<?php 
					$query = "SELECT * FROM productdownloads";
					$result = mysql_query($query);
					while($row=mysql_fetch_array($result)){
					if($rowcat['id']==$row['cateID']){
				?>
			<tr>
				<td>
					<div class="khung_sp_ds_top_c">
						<div class="khung_sp_tc_top_l"><img src="images/khung_sp_trangchu_top_l.gif" /></div>
						<div class="khung_sp_tc_top_r"><img src="images/khung_sp_trangchu_top_r.gif" /></div>
					</div>
				
					<div style="border:1px solid #ccc; background:#fff; border-top:none; padding:10px">
				
					<table style="padding:4px"></table>
					<table align="center" border="0" cellpadding="0" cellspacing="0" width="500">
						<tr>
							<td width="27"><img src="images/icon_02.gif" width="16" height="10" border="0" /></td>
							<td width="440"><a href="download.php?id=<?php echo $row[0]?>"><?php echo $row['filename'];?></a></td>                                          
							<td width="32"><a href="download.php?id=<?php echo $row['id']?>"><img src="images/nut_tai_03.gif" width="32" height="33" border="0" /></a></td>
						</tr>
					</table>
				</td>
				
			</tr>
		<?php
				}
			}
		}
		?>	
	</table>	
</body>
</html>